/*!
 * GlobalJObject.h  0.4.0 / Nov 14, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef GLOBALJOBJECT_H
#define GLOBALJOBJECT_H

#include "Cute4jCommon.h"

// GlobalJObject Class. --------------------------------------------------------

/*!
 * \brief Global JObject.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class CUTE4J_EXPORT GlobalJObject
{
public:
  GlobalJObject(JNIEnv *env, jobject obj);
  virtual ~GlobalJObject();
private:
  GlobalJObject(const GlobalJObject &);
public:
  inline jobject ref() const;
protected:
  JNIEnv *m_env;
  jobject m_obj;
};

// GlobalJObject :: Public Inline Member Function. -----------------------------

/*!
 * \brief Returns global reference.
 *
 * \return global reference
 */
inline jobject GlobalJObject::ref() const
{
  return m_obj;
}

#endif // GLOBALJOBJECT_H
